package meta.api.web.operation.presentation.form;

import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

import meta.common.util.StrUtil;

public class ValueForm implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    /**
     * 类型
     */
    @JsonProperty
    private String type;

    /**
     * Key
     */
    @JsonProperty(value = "q")
    private String queryForKey;

    /**
     * Key列表
     */
    @JsonProperty
    private List<String> keys;

    public boolean checkRequiredField4Opn() {
        if (StrUtil.isEmpty(type) && StrUtil.isEmpty(queryForKey)) {
            return false;
        }
        return true;
    }

    public boolean checkRequiredField4Usl() {
        if (StrUtil.isEmpty(type) || keys == null) {
            return false;
        }
        return true;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getQueryForKey() {
        return queryForKey;
    }

    public void setQueryForKey(String queryForKey) {
        this.queryForKey = queryForKey;
    }

    public List<String> getKeys() {
        return keys;
    }

    public void setKeys(List<String> keys) {
        this.keys = keys;
    }
}
